<?php defined('SYSPATH') or die('No direct script access.'); ?>
<style type="text/css">
    .cart3{
        padding: 30px;
        border: 1px solid gainsboro;
        width: 900px;
        margin: 10px;
    }
    .cart {

        margin: 0 auto 0;
        position: relative;
        width: 900px;
        padding: 30px;
    }
    table.userlist {
        margin: 20px auto;
        width: 100%;
        text-align: left;
        border-collapse: collapse;
    }
    .userlist .main td {
        background-color: #555555;
        color: #ffffff;
        padding: 5px 10px;
        font-weight: normal;
    }
    .userlist td {
        color: #666666;
        padding: 5px 10px;
    }
    .userlist a {
        color: #666666;
        font-weight: bold;
    }
</style>
    
<?php if($items !== NULL && count($items) >0): //$items can be array('purchaseURL' => '') ?>
<h1 style="text-align: center">My Wishlist</h1>
<table class="userlist" style="width:96%">
    <tr class="main">
        <td> &nbsp; <!-- image --></td>
        <td>Title</td>     
        <td>Price</td>
        <td>Add to Cart</td>
        <td>Remove</td>
    </tr>
<?php
foreach ($items as $i => $it)
    if(is_array($it))
        echo '<tr><td><img alt="(no image)" src="', $it['src'] ,'"/></td>
            <td style="width:50%;"><a href="/shop/product/', $it['ASIN'], 
            '">', $it['Title'], '</a></td>
            <td>', $it['Price'], '</td>
            <td><form action="/shop/cart" method="post">
            <input type="hidden" name="quantity" value="1">
            <input type="hidden" name="asin" value="', $it['ASIN'],'">
            <input id="buttonAdd" type="image" src="/images/AddToCart.png">
            </form></td> 
            <td><form action="/shop/wishlist" method="post">
            <input type="image" src="/images/button_delete_blue.png">
            <input type="hidden" name="remove" value="',$it['ASIN'],'"></form>
            </td>
            </tr>';
   ?>
   
</table>

<?php else: ?>
    <br /><br /><br />
    <center>
        <?php echo (Auth::instance()->get_user()) ? 
        'There is no items in your wishlist' : 'First you need to login';?>
    </center>
    <br /><br />
<?php endif;
